<?php
/**
 * Created by PhpStorm.
 * User: 宇
 * Date: 2016/9/29
 * Time: 9:01
 * 后台内容类
 */
namespace app\admin\controller;

use think\Controller;
use think\Session;

class Content extends Controller
{
    /*
     * 后台main页面
     */
    public function adminMain()
    {
        if (!(Session::has('username'))) {
            return 10005;
        } else {
            $lastTime=date('Y-m-d H:i:s',Session::get('lastTime'));
            $this->assign('username', Session::get('username'));
            $this->assign('lastIp', Session::get('lastIp'));
            $this->assign('lastTime', $lastTime);
            /*dump(phpinfo());
            exit();*/
            $this->assign('php_uname',php_uname());
            $this->assign('php_ver',PHP_VERSION);
            $this->assign('php_time',time());
            $this->assign('php_ip',GetHostByName($_SERVER['SERVER_NAME']));
            $this->view->replace([
                '__PUBLIC__' => '../../static/',
                '__ROOT__' => '/daogou/public/'
            ]);
            return $this->fetch('adminMain');
        }
    }
}